<?php
namespace Admin\Controller;
use Think\Controller;
use Think\Auth;
class CommenController extends Controller {

  //查询顶级导航
function _initialize(){

    $auto=new Auth;
  $rules='Admin/'.CONTROLLER_NAME.'/'.ACTION_NAME;


    // if (!$auto->check($rules,$_SESSION['admin_user']['id'])) {
    //     $this->error('您目前没有权限访问，如需帮助请联系xxx');# code...
    // }

  // $top_nav=D('nav')->where('pid=0' and 'is_hom=1')->select();
  // // print_r($top_nav);die;

  // $this->assign('top_nav',$top_nav);
  $child_nav=D('nav')->where('pid!=0')->select();


  $this->assign('child_nav', $child_nav);
//动态实例化
  $web=array('index');
  // print_r($web);die;
  //
  //
  //
  //
  if (!in_array(strtolower(CONTROLLER_NAME),$web)) {
      $this->Model=D(CONTROLLER_NAME);
  }



}





}